<!---
    Title:      EPAR1.1 
    Author:     Bruce Frick
    Purpose:    Execute Termination page
--->

<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">
<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlTerminationHeader(
    "../js/Step3-ExecTerm.js", <!---JS links--->
    "", <!---CSS links--->
    "Step 3: Terminate Employee", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->


<cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)> 
    
    <cfset LOCALS = { } />
    
    <cfif isdefined("URL.TermReqID")>
        <cfset LOCALS.TermReqID = URL.TermReqID> 
    <cfelseif isdefined("Session.TermReqID")>
        <cfset LOCALS.TermReqID = Session.TermReqID> 
    <cfelse>
        <cfset LOCALS.TermReqID = 0> 
    </cfif>
    
    <cfif isdefined("Session.intUserRosettaID")>
    
	    <cfset QUERIES = {
	        GetTermDetails = mainQueries.funcGetTermDetails( LOCALS.TermReqID, 22 ),
	        GetEmpInfoByStep = mainQueries.funcGetEmpInfoTermination( QUERIES.GetTermDetails.ActionStepID )
		} />	    

        <cfif QUERIES.GetEmpInfoByStep.recordcount EQ 0>
            This employee has already been processed in Step 3.   
            To select another user, click 
            <a href="Status.cfm" id="processed">Here</a>
            <!--- ID is checked in the JS file.  If present, don't process termination --->
        <cfelse>
            
		    <cfset QUERIES.WFCEmployeeObj = mainQueries.funcGettPersonsObj( mainQueries.funcGetRosettaObj( QUERIES.GetTermDetails.RosettaID ).HRProd_PersonIDNo ) />
                        
            <cfset objEmp = SCF_Employee_GetEmployee(QUERIES.GetTermDetails.RosettaID)>
            
		    <h1 class="title">Step 3: Terminate Employee Records</h1>
                        
		    <div class="entry">
		    
		        <p>
		            The termination of employee records has been initiated for 
		            <strong>#QUERIES.WFCEmployeeObj.FirstName# 
		            #QUERIES.WFCEmployeeObj.LastName#</strong>. 
		            Please wait while E-PAR terminates 
		            the following system records:
		        </p>
                                        
                <Cfform id="frmTermination" >
                    
                <input type="hidden" id="RosettaID" value="#QUERIES.GetTermDetails.RosettaID#" />
                <input type="hidden" id="TermReqID" value="#LOCALS.TermReqID#" />
		        
		        <table>
		            <tr>
		                <td width='25'>&nbsp;</td>
		                <td>
		                    <table>
		                        <tr>
		                            <td valign='top' nowrap="nowrap">Disable Network Account:</td>
		                            <td valign='top'>
		                                <span id="AD" class="error"></span>&nbsp;<img id="AD" src="../images/blank.gif" />
		                            </td>
		                        </tr>
		                        <tr>
		                            <td valign='top' nowrap="nowrap">Archive Home Folder:</td>
		                            <td valign='top'>
		                                <span id="HomeFolder" class="error"></span>&nbsp;<img id="HomeFolder" src="../images/blank.gif" />
		                            </td>
		                        </tr>
		                        <tr>
		                            <td valign='top'>HR Employee Record:</td>
		                            <td valign='top'>  
		                                <span id="HR" class="error"></span>&nbsp;<img id="HR" src="../images/blank.gif" />    
		                            </td>
		                        </tr>
		                        <tr>
		                            <td valign='top' nowrap="nowrap">Disable TimeKeeper:</td>
		                            <td valign='top'>
		                                <span id="TimeKeeper" class="error"></span>&nbsp;<img id="TimeKeeper" src="../images/blank.gif" />
		                            </td>
		                        </tr>
		                        <tr>
		                            <td valign='top' nowrap="nowrap">Export Mailbox:</td>
		                            <td valign='top'>
		                                <span id="ExportMail" class="error"></span>&nbsp;<img id="ExportMail" src="../images/blank.gif" />
		                            </td>
		                        </tr>
		                        <tr>
		                            <td valign='top' nowrap="nowrap">Archive User Account:</td>
		                            <td valign='top'>
		                                <span id="UserAccount" class="error"></span>&nbsp;<img id="UserAccount" src="../images/blank.gif" />
		                            </td>
		                        </tr>
		                        <tr>
		                            <td valign='top' nowrap="nowrap">Rosetta Stone Record:</td>
		                            <td valign='top'>
		                                <span id="Rosetta" class="error"></span>&nbsp;<img id="Rosetta" src="../images/blank.gif" />  
		                            </td>
		                        </tr>
		                    </table>                                    
		                </td>
		            </tr>
		            <tr>
		                <td width='25'>&nbsp;</td>
		            </tr>
		            <tr>
		                <td width='25'>&nbsp;</td>
		                <td>
		                    <span id="Notice" class="error">During this time, please refrain from refreshing the page.</span>                              
		                </td>
		            </tr>
		        </table>
                </cfform>
                
            </cfif>
            
        <cfelse>
            Session Expired.  Click <a href="Status.cfm">here</a> to redirect to the Termination Status page.                            
        </cfif>
        
    </div>

<cfelse>
    <cfinclude template="../denied.cfm">
</cfif>


<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlTerminationFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>